﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test2
{
    class ShapeFactor
    {
        public static Shape getShape(int op)
        {
            Random rd = new Random(Guid.NewGuid().GetHashCode());
            switch (op)
            {
                case 1:
                    {
                        return new Square(rd.NextDouble() * 8);
                    }
                case 2:
                    {
                        return new Rectangle(rd.NextDouble() * 8, rd.NextDouble() * 8);
                    }
                case 3:
                    {
                        return new Triangle(rd.NextDouble() * 9, rd.NextDouble() * 9);
                    }
                case 4:
                    {
                        return new Circle(rd.NextDouble() * 8);
                    }
                default:
                    {
                        return  new Circle(0);
                    }
            }
        }
    }
}
